package FactoryMethodPattern;

import FactoryMethodPattern.ConcreteObject.IDCardFactory;
import FactoryMethodPattern.ObjectFramework.Factory;
import FactoryMethodPattern.ObjectFramework.Product;

/**
 * FactoryMethodPattern工厂方法模式：使用模板方法模式生成实例（Template Method）
 * 测试类
 */
public class Test {
    public static void main(String[] args) {

        Factory factory=new IDCardFactory();
        Product card1=factory.create("小明");
        card1.use();

        Product card2=factory.create("小红");
        card2.use();

        Product card3=factory.create("小强");
        card3.use();
    }
}
